package cn.wolfcode.p2p.bussness.query;

import cn.wolfcode.p2p.base.query.QueryObject;
import cn.wolfcode.p2p.base.util.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.util.StringUtils;

import java.util.Date;

@Setter
@Getter
public class RechargOfflineQueryObject extends QueryObject {
    //状态码
    private Long state = -1L;

    //开户行
    private Long bankInfoId = -1L;

    //交易时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginDate;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;

    public Date getEndDate(){
        return DateUtil.getEndDate(endDate);
    }

    //交易号
    private String tradeCode;

    public String getTradeCode(){
        return StringUtils.hasLength(tradeCode) ? tradeCode : null;
    }
}
